home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / tjgold.zip / INSTALL.003 / DEMDESK3.PAS < prev    next >
Pascal/Delphi Source File  |  1995-05-29  |  3KB  |  114 lines

  1. {--------------------------------------------------------------------------}
  2. {                Product: TechnoJock's Turbo Toolkit GOLD                  }
  3. {                                                                          }
  4. {                     TTT GOLD - DEMO PROGRAM                        }
  5. {                                                                          }
  6. {              Copyright 1986-1995  TechnoJock Software, Inc.              }
  7. {                           All Rights Reserved                            }
  8. {                          Restricted by License                           }
  9. {--------------------------------------------------------------------------}
  10.  
  11. {Description:  DEMDESK3.PAS
  12.                An extension of DEMDESK2 with a status bar
  13.                and a help hook.
  14. }
  15.  
  16. program DEMDESK3;
  17.  
  18. uses DOS, CRT,
  19.      GoldFast, GoldWin, GoldMenu, GoldMisc, GoldDesk,
  20.      GoldKey, GoldCalc, GoldCal, GoldDate, GoldStr;
  21.  
  22. var
  23.    MainMenu,
  24.    StatusBar: Bar;
  25.    SubMenu: PopUp;
  26.    Action : dAction;
  27.  
  28. {$F+}
  29. procedure MenuHelp(ID:integer);
  30. {}
  31. begin
  32.    PromptOK(' Help! ','You asked for help on menu item ID: '+IntToStr(ID));
  33. end; { MenuHelp }
  34. {$F-}
  35.  
  36.  
  37. procedure DefineSubMenu;
  38. {}
  39. begin
  40.    InitPopUp(SubMenu);
  41.    with SubMenu do
  42.    begin
  43.       PopUpAddItem(SubMenu,'~C~alculator',101,67,'Display a calculator',nil);
  44.       PopUpAddItem(SubMenu,'Ca~l~endar',102,76,'Display a calendar',nil);
  45.       PopUpAddItem(SubMenu,'~A~bout',103,65,'Show version and copyright information',nil);
  46.       PopUpAddItem(SubMenu,'E~x~it',999,88,'~Exit~ this little demo',nil);
  47.    end;
  48. end; { DefineSubMenu }
  49.  
  50. procedure DefineMainMenu;
  51. {}
  52. begin
  53.    InitBar(MainMenu);
  54.    BarAddItem(MainMenu,'~T~ools',100,84,276,'Select one of Desktop tools',@SubMenu);
  55.    MainMenu.Style := 2;
  56.    AssignMenuHelpHook(MainMenu,MenuHelp);
  57. end; { DefineMainMenu }
  58.  
  59. procedure DefineStatusBar;
  60. {}
  61. begin
  62.    InitBar(StatusBar);
  63.    BarAddItem(StatusBar,'~F1~ Help',1001,315,315,'',nil);
  64.    BarAddItem(StatusBar,'~Alt+X~ Exit the demo',999,301,301,'',nil);
  65. end; { DefineStatusBar }
  66.  
  67. procedure DisposeMenus;
  68. {}
  69. begin
  70.    DestroyBar(MainMenu);
  71.    DestroyPopUp(SubMenu);
  72.    DestroyBar(StatusBar);
  73. end; { DisposeMenus }
  74.  
  75. {$F+}
  76. procedure MyActionProc(Choice:integer;var Action:DAction);
  77. {}
  78. begin
  79.    case Choice of
  80.      101: if LaunchCalculator(' Punch Me ') = 0 then
  81.         PromptOK(' Error ', 'Unable to display the Calculator');
  82.      102: if LaunchCalendar(TodayInJul,' Calendar ') = 0 then
  83.         PromptOK(' Error ', 'Unable to display the Calendar');
  84.      103: PromptOK(' Tools Demo ','^Copyright 1995 TechnoJock Software, Inc.|'+
  85.                      '^All Rights Reserved');
  86.      1001: PromptOK(' Tools Help ','^Honey if you need help, we got problems!');
  87.      999: Action := DFinished;
  88.    end;
  89. end; { MyActionProc }
  90. {$F-}
  91.  
  92. begin
  93. {$IFOPT D+}
  94.    HeapRecord;
  95. {$ENDIF}
  96.    DefineSubMenu;
  97.    DefineMainMenu;
  98.    DefineStatusBar;
  99.    DeskAssignMainMenu(MainMenu);
  100.    DeskAssignActionProc(MyActionProc);
  101.    DeskAssignStatusBar(Statusbar);
  102.    UseCustomChars;
  103.    SetBlinking(false);
  104.    MouseShow(true);
  105.    CursorOff;
  106.    Action := DeskProcessInput;
  107.    CursorOn;
  108.    MouseShow(false);
  109.    DisposeMenus;
  110. {$IFOPT D+}
  111.    HeapCheck;
  112. {$ENDIF}
  113. end.
  114.